<template>
   <h1>FoodView</h1>
</template>

<script setup>
import { ref,getCurrentInstance, onMounted } from 'vue';

  const {proxy} = getCurrentInstance();

  const bid = ref(null);

  const foodList = ref([]);

  const getFoodByBid = ()=>{

        if(!bid.value){
            showNotify({ message: '无商家编号无法查询' });
            return;
        }

        proxy.$axios({
          method: 'get',
          url: '/food/business/'+bid.value
        }).then(res=>{
          let resultBean = res.data;
          if(resultBean.code == 200){
            foodList.value = resultBean.data;
          }else{
            showNotify({ message: resultBean.msg });
          }
        }).catch(error=>{
          showNotify({ message: error.message });
        })
    }

  onMounted(()=>{
    console.log('*********',proxy.$route.params.bid);
    bid.value = proxy.$route.params.bid;
  })

</script>

<style>
</style>